import requestMeeting from '@/plugins/axios'
import dayjs from '../../../plugins/dayjs'
/** 获取期限设置 */
export const fetchGetMeetingDeadLine = async () =>
	requestMeeting<{ deadline: string }>({
		url: '/deadline',
		method: 'get',
	}).then((res) => (res.success && res.data ? dayjs(res.data.deadline).format('YYYY-MM-DD') : undefined))

/** 保存期限设置 */
export const fetchSaveMtDeadLine = async (date: string) =>
	requestMeeting({
		url: '/deadline',
		method: 'post',
		params: {
			dead_line: dayjs(date).tz().format('YYYY-MM-DD'),
		},
	}).then((res) => res.success)
